const fs = require("fs")

const readFilePromise = filename => 
    new Promise((resolve, reject) => {
        fs.readFile(filename, (err, data) => {
            if (err) {
                reject(err)
                return
            }
            resolve(data)
        })
    })

async function main () {
    const text = await readFilePromise("mock.txt")
    console.log(text.toString())
}

main()